package cn.sise.edu.crm.domain;

import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
@Setter
@Getter
public class TraceCustomerHistry {
    private  static final int RESULT_SUPERIOR = 3;
    private  static final int RESULT_CENTRE  = 2;
    private  static final int RESULT_BAD = 1;
    private  static final int TYPE_1 = 1;
    private  static final int TYPE_2 = 1;

    private Integer id;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date traceTime;
    private SystemDictionaryItem traceType;
    private Integer traceResult;
    private Customer customer;
    private Employee inputUser;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date inputTime;
    private Integer type;
    private String traceDetails;
    private String remark;

    public String getTraceResultValue(){
        if(RESULT_SUPERIOR == traceResult){
            return "优";
        }else if(RESULT_CENTRE == traceResult){
            return "中";
        }else if(RESULT_BAD == traceResult){
            return "差";
        }
        return "不存在";
    }

    public  String getTypeValue(){
        if(TYPE_1 == 0){
            return "潜在开发计划";
        }else if(TYPE_2 ==1){
            return "客户跟进历史";
        }
        return "毛都没有";
    }
}